/**
 * There are <a href="https://www.hdzhx.com">邯郸智讯</a> code generation
 */
package com.boxin.ims.modules.momarketing.entity.self;

import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.validator.constraints.Length;

import com.thinkgem.jeesite.common.persistence.BaseEntity;
import com.thinkgem.jeesite.modules.sys.entity.User;

/**
 * 在线报名自定义添加Entity
 * @author sogyan
 * @version 2014-03-21
 */
@Entity
@Table(name = "ims_online_signup_config_detail")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class OnlineSignupConfigDetail extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	private Long id; 		// 编号
	private User user; 		// 用户
	private String name; 	// 名称
	private int type;    //类型 1.文本；2：单选；3：复选；4：下拉；5：日期
	private String detail;  //描述
	private Date createTime = new Date();	// 创建日期
	private Long signupConfigId;  //OnlineSignConfig的id
	private String flag = YES;   //是否显示
	
	
	@Transient
	private List types ;
	@Transient
	private String detailMessage;
	
	@Transient
	public List getTypes() {
		return types;
	}

	public void setTypes(List types) {
		this.types = types;
	}


	public String getFlag() {
		return flag;
	}

	public void setFlag(String flag) {
		this.flag = flag;
	}

	@NotNull
	public int getType() {
		return type;
	}

	

	public void setType(int type) {
		this.type = type;
	}

	

	
	public Long getSignupConfigId() {
		return signupConfigId;
	}

	public void setSignupConfigId(Long signupConfigId) {
		this.signupConfigId = signupConfigId;
	}

	public String getDetail() {
		return detail;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}

	public OnlineSignupConfigDetail() {
		this.createTime = new Date();
		
	}

	public OnlineSignupConfigDetail(Long id){
		this();
		this.id = id;
	}
	

	
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	//@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_momarketing_self_onlineSignupConfigDetail")
	//@SequenceGenerator(name = "seq_momarketing_self_onlineSignupConfigDetail", sequenceName = "seq_momarketing_self_onlineSignupConfigDetail")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne
	@JoinColumn(name="user_id")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	@Length(min=1, max=200)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	
	@Transient
	public String getDetailMessage() {
		return detailMessage;
	}

	public void setDetailMessage(String detailMessage) {
		this.detailMessage = detailMessage;
	}

	


	
}


